<%@page import="java.util.Map"%>
<%@page import="java.util.Set"%>
<%@page import="java.util.Iterator"%>
<%@ page import="com.google.appengine.api.blobstore.BlobstoreServiceFactory" %>
<%@ page import="com.google.appengine.api.blobstore.BlobstoreService" %>
<%@ page import ="com.google.appengine.api.blobstore.BlobKey"%>


<% 
	RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("sdf");
	dispatcher.include(request,response);
    BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService();
	Map<String, BlobKey>  blobs = blobstoreService.getUploadedBlobs(request);
	Set songset =blobs.entrySet();
%>


<html>
    <head>
        <title>Demo Wreck</title>
    </head>
    <body>
        <form action="<%= blobstoreService.createUploadUrl("/upload") %>" method="post" enctype="multipart/form-data">
            <input type="text" name="foo">
            <input type="file" name="myFile">
            <select name="song">
            	<%Iterator<Map.Entry> b = songset.iterator(); 
            		while(b.hasNext())  {
            			Map.Entry me = (Map.Entry)b.next(); 
            			
            			%>
            		<option value="<%= me.getValue()%>"><%= me.getKey() %></option>
            	<%}%>
            	
        		</select>
            <input type="submit" value="Submit">
        </form>
    </body>
</html>
